package com.itheima.d0_homework.timu2;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) throws ParseException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入入职日期，格式为XX年XX月XX日");
        String join = scanner.next();

        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
        Date parse = sdf.parse(join);

        long time = parse.getTime();

        long systemTime = System.currentTimeMillis();

        long newTime = systemTime- time;

        int day = (int) (newTime/1000/60/60/24);

        int year = day/365;
        System.out.println("您已入职："+year+"年");
    }
}
